﻿@using Nop.Web.Models.WindAlert;
@using Nop.Web.Framework;
@model MetarModel
@{
    Layout = "~/Views/Shared/_ColumnsTwo.cshtml";
    Html.AddTitleParts("נתוני רוח לטייסים");
    Html.AddMetaDescriptionParts("נתוני רוח לטייסים metar taforץ טבלת נתוני רוח משדות תעופה בארץ ובעולם");
    Html.AddMetaKeywordParts("רוח, מצב הרוח, נתוני רוח, שדות תעופה, טייסים, metar' tafor");
    //Html.AddScriptParts("~/Windalert/Scripts/public.windalert.js");
}

<script type="text/javascript">
    $(document).ready(function () {
        $("#@Html.FieldIdFor(model => model.Airport)").keydown(function (event) {
            if (event.keyCode == 13) {
                $("#send-metar").click();
                return false;
            }
        });
    });

    function onDataBinding(e) {
        var searchModel = {
            Airport: $('#@Html.FieldIdFor(model => model.Airport)').val(),
            MetarListId: $('#MetarListId').val(),
        };
        e.data = searchModel;

    }
</script>
    <div class="row">
        <div class="col-md-5">
            @Html.Action("SpotTable", "WSpot", new { isMetar = true})
            @*<div id="spot-table" style="min-height:400px;">
                <div id="spot-table-please-wait" class="please-wait" style="display:none;"> @T("Windalert.Common.Pleasewait")</div>
            </div>
            <script type="text/javascript">
                AjaxLoader.init("spot-table", "@(Url.Action("SpotTableAjax","WSpot"))", "True","");
                AjaxLoader.action();
            </script>*@
        </div>
        <div class="col-md-7">
            <div class="panel panel-default form-panel">
                <div class="panel-heading">
                    <h3>@T("Windalert.Aviation.MetarTaf")</h3>
                </div>
                <div class="panel-body">
                    @using (Html.BeginForm())
                    {
                        <div class="message-error">
                            @Html.ValidationSummary(true)
                        </div>
                        <div class="form-fields">
                            <div class="inputs-left">
                                <div class="form-group row">
                                    @Html.LabelFor(model => model.Airport, new { @class = "col-md-2 control-label" }, ":")
                                    <div class="col-md-6">
                                        @Html.TextBoxFor(model => model.Airport, new { @class = "form-control", placeholder = T("Windalert.Aviation.AirportsExample") })
                                    </div>
                                    <div class="col-md-4">
                                        @Html.ValidationMessageFor(model => model.Airport)
                                    </div>
                                </div>
                                <div class="form-group row">
                                    @Html.LabelFor(model => model.AvailableMetars, new { @class = "col-md-2 control-label" }, ":")
                                    <div class="col-md-6">
                                        @Html.DropDownList("MetarListId", Model.AvailableMetars, new { @class = "form-control" })
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="buttons">
                            <input type="submit" name="send-metar" class="button-1 register-next-step-button btn btn-default" value="@T("ContactUs.Button")" />
                        </div>
                    }
                    <div style="direction:ltr;text-align:left;">
                        @Html.Raw(Model.MetarTafResults)
                    </div>
                </div>
            </div>
        </div>
    </div>

@*@if(!Model.IsRegistered)
    {
        @Html.Action("Login", "WCustomer");
    }*@





